<template>
  <div>
    <van-address-list
      v-model="chosenAddressId"
      :list="address"
      :switchable="false"
      default-tag-text="默认"
      @add="onAdd"
      @edit="onEdit"
    />
  </div>
</template>
<script>
import { mapState } from "vuex";
export default {
  data() {
    return {
      chosenAddressId: "1",
    };
  },
  computed: {
    ...mapState("address", ["address"]),
  },
  created() {},
  methods: {
    onAdd() {
      this.$router.push({ name: "address_add" });
    },
    onEdit(item, index) {
      this.$router.push({
        name: "address_edit",
        params: {
          item: item,
          index: index,
        },
      });
    },
  },
};
</script>
